package com.itheima.demo;

import com.itheima.domain.User;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import java.io.InputStream;
import java.util.List;


public class Demo {
    public static void main(String[] args) throws Exception {
        SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("sql.xml"));
        SqlSession session = factory.openSession();
        /*List<User> list = session.selectList("one.findAll");
        System.out.println(list);*/
        User user = session.selectOne("one.findById");
        System.out.println(user);
        session.close();


    }
}
